\(\int \cot ^5(a+b x) \, dx\) [5]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 8, antiderivative size = 42 \[ \int \cot ^5(a+b x) \, dx=\frac {\cot ^2(a+b x)}{2 b}-\frac {\cot ^4(a+b x)}{4 b}+\frac {\log (\sin (a+b x))}{b} \]

[Out]

1/2*cot(b*x+a)^2/b-1/4*cot(b*x+a)^4/b+ln(sin(b*x+a))/b

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3554, 3556} \[ \int \cot ^5(a+b x) \, dx=-\frac {\cot ^4(a+b x)}{4 b}+\frac {\cot ^2(a+b x)}{2 b}+\frac {\log (\sin (a+b x))}{b} \]

[In]

Int[Cot[a + b*x]^5,x]

[Out]

Cot[a + b*x]^2/(2*b) - Cot[a + b*x]^4/(4*b) + Log[Sin[a + b*x]]/b

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = -\frac {\cot ^4(a+b x)}{4 b}-\int \cot ^3(a+b x) \, dx \\ & = \frac {\cot ^2(a+b x)}{2 b}-\frac {\cot ^4(a+b x)}{4 b}+\int \cot (a+b x) \, dx \\ & = \frac {\cot ^2(a+b x)}{2 b}-\frac {\cot ^4(a+b x)}{4 b}+\frac {\log (\sin (a+b x))}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.26 \[ \int \cot ^5(a+b x) \, dx=\frac {\cot ^2(a+b x)}{2 b}-\frac {\cot ^4(a+b x)}{4 b}+\frac {\log (\cos (a+b x))}{b}+\frac {\log (\tan (a+b x))}{b} \]

[In]

Integrate[Cot[a + b*x]^5,x]

[Out]

Cot[a + b*x]^2/(2*b) - Cot[a + b*x]^4/(4*b) + Log[Cos[a + b*x]]/b + Log[Tan[a + b*x]]/b

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.93

method result size
derivativedivides \(\frac {-\frac {\cot \left (b x +a \right )^{4}}{4}+\frac {\cot \left (b x +a \right )^{2}}{2}-\frac {\ln \left (\cot \left (b x +a \right )^{2}+1\right )}{2}}{b}\) \(39\)
default \(\frac {-\frac {\cot \left (b x +a \right )^{4}}{4}+\frac {\cot \left (b x +a \right )^{2}}{2}-\frac {\ln \left (\cot \left (b x +a \right )^{2}+1\right )}{2}}{b}\) \(39\)
parallelrisch \(\frac {-\cot \left (b x +a \right )^{4}+2 \cot \left (b x +a \right )^{2}+4 \ln \left (\tan \left (b x +a \right )\right )-2 \ln \left (\sec \left (b x +a \right )^{2}\right )}{4 b}\) \(47\)
norman \(\frac {-\frac {1}{4 b}+\frac {\tan \left (b x +a \right )^{2}}{2 b}}{\tan \left (b x +a \right )^{4}}+\frac {\ln \left (\tan \left (b x +a \right )\right )}{b}-\frac {\ln \left (1+\tan \left (b x +a \right )^{2}\right )}{2 b}\) \(57\)
risch \(-i x -\frac {2 i a}{b}-\frac {4 \left ({\mathrm e}^{6 i \left (b x +a \right )}-{\mathrm e}^{4 i \left (b x +a \right )}+{\mathrm e}^{2 i \left (b x +a \right )}\right )}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}-1\right )^{4}}+\frac {\ln \left ({\mathrm e}^{2 i \left (b x +a \right )}-1\right )}{b}\) \(77\)

[In]

int(cot(b*x+a)^5,x,method=_RETURNVERBOSE)

[Out]

1/b*(-1/4*cot(b*x+a)^4+1/2*cot(b*x+a)^2-1/2*ln(cot(b*x+a)^2+1))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (38) = 76\).

Time = 0.27 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.98 \[ \int \cot ^5(a+b x) \, dx=\frac {{\left (\cos \left (2 \, b x + 2 \, a\right )^{2} - 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right )} \log \left (-\frac {1}{2} \, \cos \left (2 \, b x + 2 \, a\right ) + \frac {1}{2}\right ) - 4 \, \cos \left (2 \, b x + 2 \, a\right ) + 2}{2 \, {\left (b \cos \left (2 \, b x + 2 \, a\right )^{2} - 2 \, b \cos \left (2 \, b x + 2 \, a\right ) + b\right )}} \]

[In]

integrate(cot(b*x+a)^5,x, algorithm="fricas")

[Out]

1/2*((cos(2*b*x + 2*a)^2 - 2*cos(2*b*x + 2*a) + 1)*log(-1/2*cos(2*b*x + 2*a) + 1/2) - 4*cos(2*b*x + 2*a) + 2)/
(b*cos(2*b*x + 2*a)^2 - 2*b*cos(2*b*x + 2*a) + b)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (32) = 64\).

Time = 0.31 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.57 \[ \int \cot ^5(a+b x) \, dx=\begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \\x \cot ^{5}{\left (a \right )} & \text {for}\: b = 0 \\\tilde {\infty } x & \text {for}\: a = - b x \\- \frac {\log {\left (\tan ^{2}{\left (a + b x \right )} + 1 \right )}}{2 b} + \frac {\log {\left (\tan {\left (a + b x \right )} \right )}}{b} + \frac {1}{2 b \tan ^{2}{\left (a + b x \right )}} - \frac {1}{4 b \tan ^{4}{\left (a + b x \right )}} & \text {otherwise} \end {cases} \]

[In]

integrate(cot(b*x+a)**5,x)

[Out]

Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0)), (x*cot(a)**5, Eq(b, 0)), (zoo*x, Eq(a, -b*x)), (-log(tan(a + b*x)**2 +
 1)/(2*b) + log(tan(a + b*x))/b + 1/(2*b*tan(a + b*x)**2) - 1/(4*b*tan(a + b*x)**4), True))

Maxima [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.90 \[ \int \cot ^5(a+b x) \, dx=\frac {\frac {4 \, \sin \left (b x + a\right )^{2} - 1}{\sin \left (b x + a\right )^{4}} + 2 \, \log \left (\sin \left (b x + a\right )^{2}\right )}{4 \, b} \]

[In]

integrate(cot(b*x+a)^5,x, algorithm="maxima")

[Out]

1/4*((4*sin(b*x + a)^2 - 1)/sin(b*x + a)^4 + 2*log(sin(b*x + a)^2))/b

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 164 vs. \(2 (38) = 76\).

Time = 0.27 (sec) , antiderivative size = 164, normalized size of antiderivative = 3.90 \[ \int \cot ^5(a+b x) \, dx=-\frac {\frac {{\left (\frac {12 \, {\left (\cos \left (b x + a\right ) - 1\right )}}{\cos \left (b x + a\right ) + 1} + \frac {48 \, {\left (\cos \left (b x + a\right ) - 1\right )}^{2}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{2}} + 1\right )} {\left (\cos \left (b x + a\right ) + 1\right )}^{2}}{{\left (\cos \left (b x + a\right ) - 1\right )}^{2}} + \frac {12 \, {\left (\cos \left (b x + a\right ) - 1\right )}}{\cos \left (b x + a\right ) + 1} + \frac {{\left (\cos \left (b x + a\right ) - 1\right )}^{2}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{2}} - 32 \, \log \left (\frac {{\left | -\cos \left (b x + a\right ) + 1 \right |}}{{\left | \cos \left (b x + a\right ) + 1 \right |}}\right ) + 64 \, \log \left ({\left | -\frac {\cos \left (b x + a\right ) - 1}{\cos \left (b x + a\right ) + 1} + 1 \right |}\right )}{64 \, b} \]

[In]

integrate(cot(b*x+a)^5,x, algorithm="giac")

[Out]

-1/64*((12*(cos(b*x + a) - 1)/(cos(b*x + a) + 1) + 48*(cos(b*x + a) - 1)^2/(cos(b*x + a) + 1)^2 + 1)*(cos(b*x
+ a) + 1)^2/(cos(b*x + a) - 1)^2 + 12*(cos(b*x + a) - 1)/(cos(b*x + a) + 1) + (cos(b*x + a) - 1)^2/(cos(b*x +
a) + 1)^2 - 32*log(abs(-cos(b*x + a) + 1)/abs(cos(b*x + a) + 1)) + 64*log(abs(-(cos(b*x + a) - 1)/(cos(b*x + a
) + 1) + 1)))/b

Mupad [B] (verification not implemented)

Time = 16.32 (sec) , antiderivative size = 182, normalized size of antiderivative = 4.33 \[ \int \cot ^5(a+b x) \, dx=-x\,1{}\mathrm {i}+\frac {\ln \left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,2{}\mathrm {i}}-1\right )}{b}-\frac {4}{b\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}-1\right )}-\frac {8}{b\,\left (1+{\mathrm {e}}^{a\,4{}\mathrm {i}+b\,x\,4{}\mathrm {i}}-2\,{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\right )}-\frac {8}{b\,\left (3\,{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}-3\,{\mathrm {e}}^{a\,4{}\mathrm {i}+b\,x\,4{}\mathrm {i}}+{\mathrm {e}}^{a\,6{}\mathrm {i}+b\,x\,6{}\mathrm {i}}-1\right )}-\frac {4}{b\,\left (1+6\,{\mathrm {e}}^{a\,4{}\mathrm {i}+b\,x\,4{}\mathrm {i}}-4\,{\mathrm {e}}^{a\,6{}\mathrm {i}+b\,x\,6{}\mathrm {i}}+{\mathrm {e}}^{a\,8{}\mathrm {i}+b\,x\,8{}\mathrm {i}}-4\,{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\right )} \]

[In]

int(cot(a + b*x)^5,x)

[Out]

log(exp(a*2i)*exp(b*x*2i) - 1)/b - x*1i - 4/(b*(exp(a*2i + b*x*2i) - 1)) - 8/(b*(exp(a*4i + b*x*4i) - 2*exp(a*
2i + b*x*2i) + 1)) - 8/(b*(3*exp(a*2i + b*x*2i) - 3*exp(a*4i + b*x*4i) + exp(a*6i + b*x*6i) - 1)) - 4/(b*(6*ex
p(a*4i + b*x*4i) - 4*exp(a*2i + b*x*2i) - 4*exp(a*6i + b*x*6i) + exp(a*8i + b*x*8i) + 1))